package com.evil.common.mongo.service;

import com.evil.common.mongo.entity.AbstractDoubleName;
import com.evil.common.mongo.entity.DoubleName;

import java.io.Serializable;
import java.util.List;

/**
 * 统一封装db操作
 *
 * @author liyang
 * @date 2024-05-23 16:24
 */
public interface DoubleService<NAME extends Serializable, T extends DoubleName<NAME>> extends Service<AbstractDoubleName<NAME>, T> {

    /**
     * 双主键 任意匹配
     *
     * @param key key
     * @return List
     */
    List<T> findBySingleNameOrDoubleName(NAME key);

    /**
     * singleName查询
     *
     * @param singleName singleName
     * @return 获取实体列表
     */
    List<T> findListBySingleName(NAME singleName);

    /**
     * doubleName查询
     *
     * @param doubleName doubleName
     * @return 获取实体列表
     */
    List<T> findListByDoubleName(NAME doubleName);
}
